﻿<%@ Page Language="C#" MasterPageFile="~/Master.Master" Culture="th-TH" uiCulture="th" AutoEventWireup="true" CodeBehind="MP_PositionCommands.aspx.cs" Inherits="KPIS.GERP.GHRMS.APP.App_UI.Forms.MP_PositionCommands" %>
<%@ Register src="../Controls/user.ascx" tagname="user" tagprefix="uc1" %>

<asp:Content 
    ID="Content1" 
    runat="server" 
    contentplaceholderid="ContentPlaceHolder1">
    
    <title>คำสั่งปรับปรุงตำแหน่ง</title>
    <link href="../../Styles/CssClass.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../Scripts/DatePicker.js"></script>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">        
            <script type="text/javascript">
                function RowDblClick(sender, eventArgs) {
                    radopen("MP_PositionCommandDtls.aspx?CmdPosSeq=" + eventArgs.getDataKeyValue("Seq"), "CmdPosDtlsWindow");
                }

                function openRadWin() {
                    radopen("MP_PositionCommandDtls.aspx", "CmdPosDtlsWindow");
                }

                function closeRadWindow(sender, args) {
                    $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest();
                }
                function onTextChange(sender) {
                    if (sender.get_value() == "") {
                        sender.set_text("");
                    }
                }
            </script>        
    </telerik:RadCodeBlock>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="cmdSearch">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTreeView1" 
                        LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="cmdExpand">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTreeView1"
                        LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="cmdCollapse">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTreeView1" 
                        LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadTreeView1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="lblUpperText" />
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" 
                        LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" 
                        LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" 
        Height="100%" Width="75px" Transparency="50">
        <table style="height: 100%; width: 100%" border="0">
            <tr>
                <td width="100%" align="center" valign="middle">
                    <img alt="Loading..." 
                        src="../Images/Buttons/loading.gif" 
                        style="border: 0px;" />
                </td>
            </tr>
        </table>
    </telerik:RadAjaxLoadingPanel>
    <!-- <uc1:user ID="user1" runat="server" /> --> 
    <div class="Background980V3" style="width:976px; height: 24px;margin-top: 5px;margin-bottom: 5px;">
            <asp:Panel ID="PanelFilter" runat="server" Width="700px" ScrollBars="Auto">
            <table align = "center" width = "650px">
                    <tr>
                        <td align="right" >
                            ประเภทบุคลากร : </td>
                        <td align = "left">
                        <telerik:RadComboBox 
                            ID="cmbEmpType" 
                            DataTextField = "Name"
                            DataValueField = "Sequence"
                            AllowCustomText="true" 
                            runat="server" 
                            Width="200px"
                            Filter ="Contains"
                            AutoPostBack="True"
                            CausesValidation ="false"
                            ValidationGroup = "EmpType"
                            EmptyMessage="... เลือกประเภทบุคลากร ..."                 
                            onselectedindexchanged="cmbEmpType_SelectedIndexChanged">
                        </telerik:RadComboBox>
                        </td>
                                        
                        <td>
                            &nbsp;</td>
                    </tr>
                </table>
        </asp:Panel>
                    
    </div> 
    <div class="Background980V3" style="width:976px; min-height: 350px; margin-top: 0px;">
    <table align="center" width ="980px" >
    <tr>
            <td align="left" class="tableHeader">
            คำสั่งปรับปรุงตำแหน่ง</td>
    </tr>
    <tr>
    <td>
    <asp:Panel ID="Panel5" runat="server" Width = "970" ScrollBars ="Auto">
                <table align="center">
                    <tr>
                    <td>
    <telerik:RadGrid 
                    ID="RadGrid1" 
                    runat="server" 
                    AllowAutomaticDeletes="True" 
                    AllowFilteringByColumn="True" 
                    AllowMultiRowEdit="True" 
                    AllowMultiRowSelection="True" 
                    AllowPaging="True" 
                    AllowSorting="True"                     
                    AutoGenerateColumns="False" 
                    EnableAJAX="True" 
                    EnableAJAXLoadingTemplate="True" 
                    GridLines="None" 
                    OnItemCommand="RadGrid1_ItemCommand"  
                    Width="950px"                     
                    Skin="Outlook">
                    <MasterTableView 
                        AllowMultiColumnSorting="True" 
                        CellSpacing="-1" 
                        CommandItemDisplay="Top" 
                        DataKeyNames="Seq"
                        ClientDataKeyNames = "Seq"
                        InsertItemPageIndexAction="ShowItemOnCurrentPage" 
                        NoMasterRecordsText="&lt; ไม่มีข้อมูล &gt;">
                        <CommandItemTemplate>
                            <table width="100%">
                                <tr>
                                    <td>
                                        <asp:LinkButton 
                                            ID="cmdAddNew" 
                                            runat="server" 
                                            CausesValidation="False" 
                                            CommandName="InitInsert"                                           
                                            Visible="<%# !RadGrid1.MasterTableView.IsItemInserted && RadGrid1.EditIndexes.Count <= 0 %>">
                                        <img style="border:0px;vertical-align:middle;" alt="" 
                                        src="../Images/Buttons/AddRecord.gif" /> จัดทำร่างคำสั่ง</asp:LinkButton>
                                        &nbsp;&nbsp;                                       
                                    </td>
                                </tr>
                            </table>
                        </CommandItemTemplate>
                        <RowIndicatorColumn>
                            <HeaderStyle Width="20px" />
                        </RowIndicatorColumn>
                        <ExpandCollapseColumn>
                            <HeaderStyle Width="20px" />
                        </ExpandCollapseColumn>
                        <Columns>
                            <telerik:GridEditCommandColumn 
                                ButtonType="ImageButton"
                                EditText = "คลิกเพื่อแก้ไขรายการ"
                                ItemStyle-Width="15">
                                <ItemStyle HorizontalAlign="Center" Width="15px" />
                            </telerik:GridEditCommandColumn>
                            <telerik:GridButtonColumn 
                                ButtonType="ImageButton" 
                                CommandName="Delete" 
                                ConfirmDialogType="RadWindow" 
                                ConfirmText="ลบข้อมูลที่เลือก?" 
                                ItemStyle-Width="15" 
                                Text="คลิกเพื่อลบรายการ" 
                                UniqueName="column1">
                                <ItemStyle HorizontalAlign="Center" Width="15px" />
                            </telerik:GridButtonColumn>
                            <telerik:GridBoundColumn 
                                DataField="Seq" 
                                DataType="System.Int32" 
                                Display="False" 
                                HeaderText="Seq" 
                                ReadOnly="True" 
                                UniqueName="Seq" 
                                Visible="False">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn 
                                DataField="CmdRefNo" 
                                FilterControlWidth = "100%"
                                AutoPostBackOnFilter ="true"
                                ShowFilterIcon ="false"
                                HeaderStyle-HorizontalAlign="Center" 
                                HeaderText="คำสั่งเลขที่" 
                                UniqueName="CmdRefNo" >
                                <HeaderStyle HorizontalAlign="Center" Width="100px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn 
                                DataField="Description" 
                                FilterControlWidth = "100%"
                                AutoPostBackOnFilter ="true"
                                ShowFilterIcon ="false"
                                HeaderStyle-HorizontalAlign="Center" 
                                HeaderText="เรื่อง" 
                                UniqueName="Description">
                                <HeaderStyle HorizontalAlign="Center" Width="200px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn 
                                DataField="ApprovedDate" 
                                FilterControlWidth = "100%"
                                AutoPostBackOnFilter ="true"
                                ShowFilterIcon ="false"
                                HeaderStyle-HorizontalAlign="Center" 
                                HeaderText="คำสั่งลงวันที่" 
                                UniqueName="ApprovedDate" 
                                DataFormatString ="{0:dd/MM/yyyy}" >
                                <HeaderStyle HorizontalAlign="Center" Width="80px" />
                                <ItemStyle HorizontalAlign="Center" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn 
                                DataField="ApprovedName" 
                                FilterControlWidth = "100%"
                                AutoPostBackOnFilter ="true"
                                ShowFilterIcon ="false"
                                HeaderStyle-HorizontalAlign="Center" 
                                HeaderText="ผู้อนุมัติ" 
                                UniqueName="ApprovedName">
                                <HeaderStyle HorizontalAlign="Center" Width="200px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn 
                                DataField="ApprovedPosition" 
                                FilterControlWidth = "100%"
                                AutoPostBackOnFilter ="true"
                                ShowFilterIcon ="false"
                                HeaderStyle-HorizontalAlign="Center" 
                                HeaderText="ตำแหน่ง" 
                                UniqueName="ApprovedPosition">
                                <HeaderStyle HorizontalAlign="Center" Width="200px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn Visible = "false"
                                DataField="CmdStatusName" 
                                FilterControlWidth = "100%"
                                AutoPostBackOnFilter ="true"
                                ShowFilterIcon ="false"
                                HeaderStyle-HorizontalAlign="Center" 
                                HeaderText=" " 
                                UniqueName="CmdStatusName">
                                <HeaderStyle HorizontalAlign="Center" Width="200px" />
                            </telerik:GridBoundColumn>
                        </Columns>
                        <EditFormSettings EditFormType="WebUserControl" 
                            UserControlName="../UserControls/MP_PositionCommands.ascx">
                            <EditColumn UniqueName="EditCommandColumn1">
                            </EditColumn>
                        </EditFormSettings>
                        <PagerStyle Mode="NextPrevNumericAndAdvanced" AlwaysVisible="true"/>
                    </MasterTableView>                                      
                    <ClientSettings 
                        AllowColumnHide="True" 
                        AllowColumnsReorder="True" 
                        EnableRowHoverStyle="True" 
                        ReorderColumnsOnClient="True">
                        <Selecting AllowRowSelect="True" EnableDragToSelectRows="true" />
                        <ClientEvents OnRowDblClick="RowDblClick" />
                    </ClientSettings>
                </telerik:RadGrid>
                </td>
                </tr>
                </table>
                </asp:Panel>
    </td>
    </tr>
    </table>
    </div>          
                
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
        <Windows>
        <telerik:RadWindow 
            ID="CmdPosDtlsWindow" 
            runat="server" 
            Title="รายละเอียดการปรับปรุงตำแหน่ง" 
            Height="550px"
            Width="1000px" 
            ReloadOnShow="true" 
            ShowContentDuringLoad="false"
            Modal="true"  
            Skin = "Vista"
            OnClientClose="closeRadWindow" />
        </Windows>
     </telerik:RadWindowManager>                
</asp:Content>